public class CargoBoat {
	int realContent;
	int maxContent;
	int minContent;
	public void setMaxContent(int c) {
		maxContent = c;
	}
	public void setMinContent(int q){
		minContent = q;
	}
	public void loading(int m) throws DangerException {
		realContent +=m;
		if(realContent>maxContent) {
			realContent -=m;
			throw new DangerException();
		}
		System.out.println("目前装载了"+realContent+"吨货物");
	}
	public void loading2(int m2) throws DangerException2 {
                realContent +=m2;
                if(realContent<minContent) {
                        realContent -=m2;
                        throw new DangerException2();
                }
                System.out.println("目前装载了"+realContent+"吨货物");
        }
}
